from datetime import datetime

from django.shortcuts import render


# Create your views here.

def index(request):
    context = {
        'city': '广州',
        'date':datetime.now(),

    }
    return render(request, 'index.html', context=context)


def myfilter(request):
    context = {
        'city': '广州',
        'adict': {
            'name': '西游记',
            'author': '吴承恩'
        },
        'alist': ['a', 'b', 'c', 'd', 'e'],  # ->  ['a', 'b', '过滤了', 'd', 'e']
        'age': 25,
        'gender': '男',
        'html': '<p style="color:red">text</p>',
        'today': datetime.now()
    }
    return render(request, 'filter.html', context=context)


def myextend(request):
    return render(request, 'son.html', context={})


def myjinja(request):
    d = {
        'alist': ['a', 'b', 'c', 'd', 'e','f','g','h','i','j' ]
    }
    return render(request, 'jinja.html', context=d)
